<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>标准信息列表</title>
<script type="text/javascript" src="script/jquery-1.10.2.js"></script>
<script type="text/javascript">
	$(function() {
		$("#add").click(function() {
			location.href = "editPage";
		});
		$("#checkAll").click(function() {
			$("input[name=deleteId]").prop("checked", $(this).prop("checked"));
		});
		$("#delete").click(function() {
			$("#openForm").attr({
				"action" : "delete",
				"method" : "post"
			}).submit();
		});
	});
</script>
<style>
body {
	margin: 0;
	padding: inherit;
}

#container {
	text-align: center;
	margin: 0px auto;
	width: 850px;
}

table {
	width: 800px;
	margin: 0px;
}

table tr td {
	width: 100px;
	border: 1px solid black;
	padding: 3px;
}

.sp {
	text-align: right;
}

table tr:nth-of-type(even) {
	background-color: gray;
}
</style>
</head>
<body>
	<div id="container">
		<h3>标准信息列表</h3>
		<form id="openForm" action="index" method="get">
			<table cellpadding="0" cellspacing="0">
				<tr class="sp">
					<td colspan="7"><input type="text" name="text" value="${text}" />&nbsp;
						<input type="submit" id="search" value="提交检索" />&nbsp; <input
						type="button" id="add" value="新增标准" />&nbsp; <input type="button"
						id="delete" value="删除标准" /></td>
				</tr>
				<tr>
					<td><input type="checkbox" id="checkAll" /></td>
					<td>标准号</td>
					<td>中文名称</td>
					<td>版本</td>
					<td>发布日期</td>
					<td>实施日期</td>
					<td>操作</td>
				</tr>
				<c:forEach items="${list }" var="s">
					<tr>
						<td><input type="checkbox" name="deleteId" value="${s.id }" /></td>
						<td>${s.stdNum }</td>
						<td>${s.zhname }</td>
						<td>${s.version }</td>
						<td>${s.releaseDate }</td>
						<td>${s.implDate }</td>
						<td><a href="editPage?id=${s.id }">修改</a> 
						<!--可以使用流来修改  -->
						<c:if test="${s.packagePath!='empty' }">
						<a href="${s.packagePath }">下载</a>
						</c:if>
						<c:if test="${s.packagePath=='empty' }">
						<a>下载</a>
						</c:if>
						</td>
					</tr>
				</c:forEach>
				</form>
				<tr class="sp">
					<td colspan="7"><c:if test="${pageNum>1 }">
							<a href="index?pageNum=1&text=${text }">首页</a>
						</c:if> <c:if test="${pageNum<=1 }">
							<a>首页</a>
						</c:if>| <c:if test="${pageNum<=1 }">
							<a>上一页</a>
						</c:if> <c:if test="${pageNum > 1 }">
							<a href="index?pageNum=${pageNum-1}&text=${text }">上一页</a>
						</c:if>| <c:if test="${pageNum<totalPage }">
							<a href="index?pageNum=${pageNum+1 }&text=${text }">下一页</a>
						</c:if> <c:if test="${pageNum>=totalPage }">
							<a>下一页</a>
						</c:if> | <c:if test="${pageNum<totalPage }">
							<a href="index?pageNum=${totalPage }&text=${text }">末页</a>
						</c:if> <c:if test="${pageNum == totalPage }">
							<a>末页</a>
						</c:if> &nbsp;&nbsp; 第${pageNum}页/共${totalPage}页</td>
				</tr>
			</table>
	</div>
</body>
</html>